from random import randint

PROVINCE_CHOICES = (
    # (11, u'北京市'),
    # (12, u'天津市'),
    # (13, u'河北省'),
    # (14, u'山西省'),
    # (15, u'内蒙古自治区'),
    # (21, u'辽宁省'),
    # (22, u'吉林省'),
    # (23, u'黑龙江省'),
    # (31, u'上海市'),
    (32, u'江苏省'),
    # (33, u'浙江省'),
    # (34, u'安徽省'),
    # (35, u'福建省'),
    # (36, u'江西省'),
    # (37, u'山东省'),
    # (41, u'河南省'),
    # (42, u'湖北省'),
    # (43, u'湖南省'),
    # (44, u'广东省')
)

CITY_CHOICES = (
    (3201, u'南京'),
)

AREA_CHOICES = (
    (320101, u'市辖区'),
    (320102, u'玄武区'),
    (320104, u'秦淮区'),
    (320105, u'建邺区'),
    (320106, u'鼓楼区'),
    (320111, u'浦口区'),
    (320113, u'栖霞区'),
    (320114, u'雨花台区'),
    (320115, u'江宁区'),
    (320116, u'六合区'),
    (320117, u'溧水区'),
    (320118, u'高淳区'),
)


def format_datetime(datetime):
    if datetime:
        return datetime.strftime('%Y-%m-%d %H:%M')
    return None


def generate_out_order_id(datetime):
    timestamp = datetime.strftime('%Y%m%d%H%M%S%f')
    return '%s%8d' % (timestamp, randint(10000000, 99999999))
